<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <![endif]-->
    <title>Free Responsive Admin Theme - ZONTAL</title>
    <!-- BOOTSTRAP CORE STYLE  -->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FONT AWESOME ICONS  -->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
    <!-- CUSTOM STYLE  -->
    <link href="assets/css/style.css" rel="stylesheet" />
    <!-- HTML5 Shiv and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<header>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <strong>你好， </strong>info@yourdomain.com
                &nbsp;&nbsp;
                <strong><a href="#">退出</a> </strong>+90-897-678-44
            </div>

        </div>
    </div>
</header>
<!-- HEADER END-->
<div class="navbar navbar-inverse set-radius-zero">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index.html">

                <img src="assets/img/logo.png" />
            </a>

        </div>

        <div class="left-div">
            <div class="user-settings-wrapper">
                <ul class="nav">

                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                            <span class="glyphicon glyphicon-user" style="font-size: 25px;"></span>
                        </a>
                        <div class="dropdown-menu dropdown-settings">
                            <div class="media">
                                <a class="media-left" href="#">
                                    <img src="assets/img/64-64.jpg" alt="" class="img-rounded" />
                                </a>
                                <div class="media-body">
                                    <h4 class="media-heading">Jhon Deo Alex </h4>
                                    <h5>Developer & Designer</h5>

                                </div>
                            </div>
                            <hr />
                            <h5><strong>Personal Bio : </strong></h5>
                            Anim pariatur cliche reprehen derit.
                            <hr />
                            <a href="#" class="btn btn-info btn-sm">Full Profile</a>&nbsp; <a href="login.html" class="btn btn-danger btn-sm">Logout</a>

                        </div>
                    </li>


                </ul>
            </div>
        </div>
    </div>
</div>
<!-- LOGO HEADER END-->
<section class="menu-section">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="navbar-collapse collapse ">
                    <ul id="menu-top" class="nav navbar-nav navbar-right">
                        <li><a class="menu-top-active" href="http://localhost:8083/money.html">我的支付宝</a></li>
                        <li><a href="ui.html">账户设置</a></li>
                        <li><a href="http://localhost:8083/dealinfo.html">交易记录</a></li>
                        <li><a href="http://localhost:8083/product.html">商品商城</a></li>
                        <li><a href="http://localhost:8083/coupon.html">商品优惠券</a></li>
                        <li><a href="http://localhost:8083/youhuijuanling.html">我的优惠券</a></li>
                        <li><a href="http://localhost:8083/recycle.html">回收站</a></li>

                    </ul>
                </div>
            </div>

        </div>
    </div>
</section>
<!-- MENU SECTION END-->
<div class="content-wrapper">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <h4 class="page-head-line">
                    充值
                </h4>
                <h5>充值金额
            <span id="divMoney">
                </span>元
                </h5>
            </div>
            <table id="bank"></table>
            <br/>
            <div class="form-group">
                <label for="payPwd">支付密码</label>
                <input type="text" class="form-control"  name=""  id="payPwd" placeholder="支付密码">
            </div>

            <br/>
            <a class="btn btn-social btn-facebook" href="javaScript:comPay()">
                <i class="fa fa-facebook"></i>&nbsp; 确认付款</a>

        </div>
                </div>
            </div>

<!-- CONTENT-WRAPPER SECTION END-->
<footer>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                &copy; 2015 YourCompany | By : <a href="http://www.designbootstrap.com/" target="_blank">DesignBootstrap</a>
            </div>

        </div>
    </div>
</footer>
<!-- FOOTER SECTION END-->
<!-- JAVASCRIPT AT THE BOTTOM TO REDUCE THE LOADING TIME  -->
<!-- CORE JQUERY SCRIPTS -->
<script src="assets/js/jquery-1.11.1.js"></script>
<!-- BOOTSTRAP SCRIPTS  -->
<script src="assets/js/bootstrap.js"></script>
<!-- 引入bootstrap-table的js-->
<script src="/assets/table/bootstrap-table.min.js"></script>
<script src="/assets/table/locale/bootstrap-table-zh-CN.min.js"></script>
<!-- 引入bootstrap-table的css -->
<link  href="/table/bootstrap-table.min.css" rel="stylesheet" >
<!-- 引入my97 -->
<script src="/my97/WdatePicker.js"></script>
<!-- 引入bootstrap的js-->
<script src="/bootstrap/js/bootstrap.min.js"></script>
<!-- 引入bootstrap的js-->
<script src="/treeview/bootstrap-treeview.min.js"></script>
<!-- 引入bootstrap的css -->
<link  href="/bootstrap/css/bootstrap.min.css" rel="stylesheet" >
<!-- 引入bootstrap-treeview的css -->
<link  href="/treeview/bootstrap-treeview.min.css" rel="stylesheet" >
<!-- 引入bootbox.js -->
<script src="/bootbox/bootbox.js"></script>
<script>

    $(function () {
        $.ajax({
            url:'http://localhost:8056/dealinfo/getBank',
            type:'get',
            async:false,
            success:function (data) {
                var name='';
                for( var i = 0; i < data.length; i++ ){

                   name +='<tr>\n' +
                        '<td><input type="radio" name="payMethod" value="'+data[i].bank_id+'">'+data[i].bank_name+'</td>\n'+
                        '</tr>';
                }
            $("#bank").html(name);
            }
        })
    })

    //获取路径中的参数
    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }

    // 调用方法
    var money=GetQueryString("money");
    var id=GetQueryString("id");
    $("#divMoney").html(money);
    
    //确认付款
    function comPay() {
        bootbox.dialog({
            title: '付款提示',
            message: '您确认要付款吗？',
            buttons: {
                cancel: {
                    label: "取消",
                    className: 'btn-danger',
                    callback: function(){
                        return true;
                    }
                },
                ok: {
                    label: "确定",
                    className: 'btn-info',
                    callback: function(){
                        $("[name='payMethod']:checked").each(
                            function(){
                                val_payPlatform = $(this).val();
                            }
                        )
                        payPwd=$("#payPwd").val();
                        $.ajax({
                            url:'http://localhost:8056/dealinfo/putAccountMoney',
                            type:'put',
                            data:{"dealMoney":money,"dealId":id,"payPwd":payPwd,
                            "accountAmount":money,"bankId":val_payPlatform,"bankMoney":money},
                            success:function (data) {
                                if(data==1){
                                    bootbox.alert("充值成功");
                                    location.href="money.html";
                                }else{
                                    bootbox.alert("密码错误");
                                }
                            }
                        })
                    }
                }}})
    }

</script>
</body>
</html>
